/**
 * Copyright (C), 2018 store
 * Encoding: UTF-8
 * Date: 20-4-26 下午2:25
 * History:
 */
package com.swak.frame.datasource.config;

import java.util.Map;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import com.swak.frame.SwakConstants;

/**
 * #扩展 多个数据源## swak.datasource.filePath=classpath:conf/datasource.properties
 * swak.datasource.configLocation=classpath:mybatis/sqlmap-config.xml
 * swak.datasource.mapperLocations[0]=classpath:mybatis/sqlmapper/*.xml ###
 * 配置数据信息
 * swak.datasource.database.db1.mapper=xx.persistence.mapper
 * swak.datasource.database.db1.mapperLocations[0]=classpath:mybatis/sqlmapper/*.xml
 * swak.datasource.database.db1.master= swak.datasource.database.db1.slaves[0]=
 * 
 * @ClassName: DataSourcePropertie.java
 * @author: colley.ma
 * @date: 2022/03/17 15:21:50
 */
@ConfigurationProperties(prefix = SwakConstants.SWAK_DATA_SOURCE)
@Validated
public class DataSourcePropertie {

	
	/**
	 * sqlmap-config path
	 */
	@NotBlank
	private String configLocation;

	/**
	 * sqlmapper path
	 */
	@NotEmpty
	private String[] mapperLocations;

	@NotNull
	private Map<String,DataBasePropertie> database;

	public String getConfigLocation() {
		return configLocation;
	}

	public void setConfigLocation(String configLocation) {
		this.configLocation = configLocation;
	}

	public String[] getMapperLocations() {
		return mapperLocations;
	}

	public void setMapperLocations(String[] mapperLocations) {
		this.mapperLocations = mapperLocations;
	}

	public Map<String, DataBasePropertie> getDatabase() {
		return database;
	}

	public void setDatabase(Map<String, DataBasePropertie> database) {
		this.database = database;
	}
}
